<?php
	include ('paperclip_sc_fns.php');
	// The shopping cart needs sessions, so start one
	session_start();

	$catid = $_GET['catid'];
	$name = get_category_name($catid);

	do_html_header($name);

	//show categories all the time
	display_shopping_menu($_SESSION['cat_array']);
	display_cart_tool();
	// get the paperclip info out from db
	$paperclip_array = get_paperclips($catid);

	display_paperclips($paperclip_array);


	// if logged in as admin, show add, delete paper links
	if(isset($_SESSION['admin_user'])) {
		display_button("index.php", "continue", "Continue Shopping");
		//display_button("admin.php", "admin-menu", "Admin Menu");
		display_button("edit_category_form.php?catid=".$catid,
									 "edit-category", "Edit Category");
	}// else {
	//	display_button("index.php", "continue-shopping", "Continue Shopping");
	//}

	do_html_footer();
?>
